﻿Public Class GajiUtil
    Private Enum GolonganMapping
        A = 1
        B = 2
        C = 3
        D = 4
    End Enum

    Public Enum GajiPokok
        A = 1400000
        B = 1800000
        C = 2200000
        D = 2600000
    End Enum

    Public Enum GajiLembur
        A = 10000
        B = 13000
        C = 17000
        D = 20000
    End Enum

    Public Enum UangMakan
        A = 25000
        B = 25000
        C = 27000
        D = 29000
    End Enum

    Public Property Golongan As String
    Public Property Presensi As Integer
    Public Property Lembur As Integer

    Private Function getGolongan() As String
        Return [Enum].GetName(GetType(GolonganMapping), Integer.Parse(Golongan))
    End Function

    Public Function getGajiPokok() As Double
        Return [Enum].Parse(GetType(GajiPokok), getGolongan())
    End Function

    Public Function getGajiLembur() As Double
        Return [Enum].Parse(GetType(GajiLembur), getGolongan())
    End Function

    Public Function getUangMakan() As Double
        Return [Enum].Parse(GetType(UangMakan), getGolongan())
    End Function

    Public Function getTotalGajiLembur() As Double
        Return Lembur * getGajiLembur()
    End Function

    Public Function getTotalUangMakan() As Double
        Dim uangMakan = getUangMakan()
        Dim standarBulanan = uangMakan * Presensi
        Dim lemburBulanan = uangMakan * Lembur

        'Return standarBulanan + lemburBulanan
        Return 0
    End Function

    Public Function getTotalGaji() As Double
        Return getGajiPokok() + getTotalGajiLembur() + getTotalGaji + getTotalUangMakan()
    End Function

End Class
